import Model from '../index'

class Articles extends Model {

  // 获取文章分页列表
  getArticlePageList (options) {
    options.url = '/api/fontend/articles/getArticlePageList'
    return this.post(options)
  }

  // 获取文章详情
  getArticleDetail (options) {
    options.url = '/api/fontend/articles/getArticleDetail'
    return this.post(options)
  }

  // 删除文章
  deleteArticle (options) {
    options.url = '/api/fontend/articles/deleteArticle'
    return this.post(options)
  }

  // 添加文章
  addArticle (options) {
    options.url = '/api/fontend/articles/addArticle'
    return this.post(options)
  }

  // 添加文章标签
  addArticleTags (options) {
    options.url = '/api/fontend/articles/addArticleTags'
    return this.post(options)
  }

  // 文章点赞/取消点赞
  updateLikeArticle (options) {
    options.url = '/api/fontend/articles/updateLikeArticle'
    return this.post(options)
  }

  // 文章收藏/取消收藏
  updateCollectArticle (options) {
    options.url = '/api/fontend/articles/updateCollectArticle'
    return this.post(options)
  }

  // 文章评论列表
  getArticleCommentList (options) {
    options.url = '/api/fontend/articles/getArticleCommentList'
    return this.post(options)
  }

  // 添加文章评论
  addArticleComment (options) {
    options.url = '/api/fontend/articles/addArticleComment'
    return this.post(options)
  }

  // 删除文章评论
  deleteArticleComment (options) {
    options.url = '/api/fontend/articles/deleteArticleComment'
    return this.post(options)
  }

}

const articlesModel = new Articles()
export default articlesModel
